; using NASM
; TODO
; - Add example of relocation table
        BITS 16

; --> CONSTANTS <--
sys_exit            equ 4Ch          ; 4C is the exit for int 21h
func_dispatch       equ 21h		     ; MS-DOS function dispatcher
									 ; and General interrupt
stout				equ 09h          ; writes string to display

; --> PROGRAM START <--
start:
        push cs     			     ; Point data seg to code seg
        push ds
        
        mov dx, [message]            ; Load ptr to string for call.
        mov ah, stout                ; 9 is print argument for int 21h
        int         func_dispatch    ; Execute action
        
exit:                                ; program exit routine.
point   mov         al, return_code  ; setup return
        mov         ah, sys_exit     ; program terminiate setup
        int         func_dispatch    ; Execute action

; --> VARIABLES <--
return_code        db 0              ; default 0 == success
                                     ; other than 0 for failure
; Message string
message         db    'Hexena DOS Stub!',0Dh,0Ah,'$'
    ; 0D  := CR (Carriage Return)
    ; 0a  := LF (Line Feed)
    ; '$' := String Terminator in MS-DOS (similar to \0 in C)